|
|
|
|
|
|
|
Finally, after successfully opening the connection to the database, the Connection object properties are displayed. Unfortunately, the Connection object does not support the use of the Properties collection. This makes coding the property display a bit more labor-intensive than coding the other DAO objects. |
|
|
|
|
|
|
|
|
Save and run the project. When you press the Connection button, you see the Connection property list appear on your screen (see Figure 9.22). |
|
|
|
|
|
|
|
|
Figure 9.22.
Viewing the Connection object property list. |
|
|
|
|
|
|
|
|
The Recordset Data Object |
|
|
|
|
|
|
|
|
By far, the most commonly used objects in Visual Basic programming are the objects that contain datasets. In the Microsoft Jet object model, this object is the Recordset object. Recordset objects can be created from the Database object, the Connection Object, the QueryDef object, and even from another Recordset object. This list of parent objects speaks to the importance of the Recordset as the primary data object in the Microsoft Jet DAO. |
|
|
|
|
|
|
|
|
The property and method list of the Recordset also reflects its versatility and importance. We have mentioned many of the Recordset's methods in previous chapters. You'll also use the Recordset methods in the next chapter, ''Creating Database Programs with Visual Basic Code." The property list of the Recordset object is also quite extensive. Even more important, the exact methods and properties available for the Recordset depend on whether the Recordset was created within an ODBCDirect workspace or a Microsoft Jet workspace. |
|
|
|
|
|
|
|
|
Rather than take up space in the book to list these methods and properties, look up the "Recordset Object, Recordset Collection Summary" topic in the Visual Basic 5 help files. This help topic lists every method and property with extensive notes regarding the differences between ODBCDirect and Microsoft Jet. You can also use this help topic as a starting point for exploring the details of each method and property. |
|
|
|
|
|
|
|
|
However, to illustrate the differences and similarities between ODBCDirect Recordsets and Microsoft Jet Recordsets, add a new button to the form. Set its Name property to cmdRecordsets and its caption to Recordsets. Now add the code from Listing 9.23 to the cmdRecordsets_Click event. |
|
|
|
|
|